<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>DCO签署状态</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-4">
    <h1>DCO签署状态</h1>

    <!-- 查询表单 -->
    <form method="get" th:action="@{/index}" class="form-inline mb-4">
        <div class="form-group mr-2">
            <input type="text" name="repoName" class="form-control" placeholder="仓库名称"
                   th:value="${repoName}">
        </div>
        <div class="form-group mr-2">
            <input type="text" name="repoOwner" class="form-control" placeholder="仓库所有者"
                   th:value="${repoOwner}">
        </div>
        <div class="form-group mr-2">
            <input type="text" name="pusher" class="form-control" placeholder="推送者"
                   th:value="${pusher}">
        </div>
        <button type="submit" class="btn btn-primary">查询</button>
    </form>

    <!-- 提交状态表格 -->
    <table class="table table-bordered table-striped">
        <thead class="thead-dark">
        <tr>
            <th>仓库名称</th>
            <th>仓库所有者</th>
            <th>推送者</th>
            <th>提交SHA</th>
            <th>是否签署</th>
            <th>接收时间</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="commitStatus : ${commitStatuses}">
            <td th:text="${commitStatus.repositoryName}">仓库名称</td>
            <td th:text="${commitStatus.repositoryOwner}">仓库所有者</td>
            <td th:text="${commitStatus.pusher}">推送者</td>
            <td th:text="${commitStatus.sha}">提交SHA</td>
            <td>
                <span th:text="${commitStatus.isSigned} ? '是' : '否'"
                      th:classappend="${commitStatus.isSigned} ? 'text-success' : 'text-danger'"></span>
            </td>
            <td th:text="${#temporals.format(commitStatus.receivedAt, 'yyyy-MM-dd HH:mm:ss')}">接收时间</td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>
